package com.example.domain;

import java.io.Serializable;

public class OrderedMenuItem implements Serializable {
	private int id;
	private MenuItem menuItem;
	private int amount = 0;
	
	public OrderedMenuItem(MenuItem menuItem) {
		this.id = menuItem.getId();
		this.menuItem = menuItem;
	}
	
	public int increaseAmountByOne() { 
		amount++;
		return amount;
	}
	
	public int decreaseAmountByOne() {
		if (amount > 0)
			amount--;
		return amount;
	}
	
	public int getId() { return id; }
	public MenuItem getMenuItem() { return menuItem; }
	public int getCurrentAmount() { return amount; }
}
